package xyz.xfcloud.jol;

import org.openjdk.jol.info.ClassLayout;

/**
 * Created by JiZhi on 2020/5/4
 */
public class JolTest {
    public static void main(String[] args) {
        Object o = new Object();
        System.out.println(ClassLayout.parseInstance(o).toPrintable());
        synchronized (o){
            System.out.println(ClassLayout.parseInstance(o).toPrintable());
        }
        A a = new A();
        System.out.println(ClassLayout.parseInstance(a).toPrintable());
        synchronized (a){
            System.out.println(ClassLayout.parseInstance(a).toPrintable());
        }
        System.out.println(ClassLayout.parseInstance(o).toPrintable());
        System.out.println(ClassLayout.parseInstance(a).toPrintable());
    }
}

class A{
    int m = 1;
    double n = 3.14;
    float k = 2.3f;
}
